<?php
class Login_Model extends CI_Model{
	
	
	 function __construct(){
        // Call the Model constructor
        parent::__construct();
    }
	
	function doLogin($username,$password){
		$sql="SELECT * FROM user WHERE username='".$username."' AND password='".$password."' LIMIT 1";
		//echo $sql;
		$query=$this->db->query($sql);
		if ($query->num_rows()>0){
			return $query->row_array();
		}else{
			return false;
		}	
	}
	
	function cekStatus($id){
		$sql="SELECT * FROM user WHERE id_user=$id";
		//echo $sql;
		$query=$this->db->query($sql);
		
		if ($query->num_rows()>0){
			$tmp_data=$query->row_array();
			if($tmp_data['status_aktif']==1){
				return true;
			}else{
				return false;
			}
		}else{
			return false;
		}	
	}	

}
?>